//SPU请求类型
interface ResponseData {
    code: number;
    message: string;
    ok: boolean;
}

// SPU数据类型
export interface SpuData{
    id?:number,
    spuName:string,
    description:string,
    tmId:number|string,
    spuImageList:null|SpuImg[],
    spuSaleAttrList:null|SaleAttr[],
    category3Id:number|string,
}
//数组：元素都是已有SPU数据类型
export type Records = SpuData[]
// 定义获取已有的SPU接口返回的数据ts类
export interface HasSpuResponseData extends ResponseData{
    data: {
        records:Records,
        total:number,
        size:number,
        current:number,
        searchCount:boolean,
        pages:number
    }
}

//品牌的数据类型
export interface Trademark{
    id:number,
    tmName:string,
    logoUrl:string
}
// 所有品牌的数据类型
export interface AllTradeMark extends ResponseData{
    data:Trademark[]
}
// 品牌对应图片的类型
export interface SpuImg{
    id?:number,
    createTime?:string,
    updateTime?:string,
    spuId?:number,
    imgName?:string,
    imgUrl?:string
    name?:string,
    url?:string
}
export interface SpuHasImg extends ResponseData{
    data:SpuImg[]
}
//销售数据的数据类型
export interface SaleAttrValue{
    baseSaleAttrId:number|string,
    saleAttrName:string,
    id?:number,
    createTime?:string,
    updateTime?:string,
    spuId?:number,
    saleAttrValueName?:string,
    isChecked?:null
}
export type SpuSaleAttrValueList = SaleAttrValue[]
export interface SaleAttr{
    baseSaleAttrId:number|string,
    saleAttrName:string,
    spuSaleAttrValueList:SpuSaleAttrValueList,
    id?:number,
    createTime?:string,
    updateTime?:string,
    spuId?:number,
    flag?:boolean,
    saleAttrValue?:string
}
export interface SaleAttrResponseData extends ResponseData{
    data:SaleAttr[]
}
//已有的全部SPU的返回数据ts类型
export interface HasSaleAttr{
    id:number,
    name:string
}
export interface HasSaleAttrResponseData extends ResponseData{
    data:HasSaleAttr[]
}
//SKU
interface SkuAttrValueList {
    attrId: number|string;
    valueId: number|string;
}
interface SkuSaleAttrValueList {
    saleAttrId: number|string;
    saleAttrValueId: number|string;
}
export interface SkuData {
    category3Id: number|string;
    spuId: number|string;
    tmId: number|string;
    skuName: string;
    price: number|string;
    weight: string|number;
    skuDesc: string;
    skuAttrValueList: SkuAttrValueList[];
    skuSaleAttrValueList: SkuSaleAttrValueList[];
    skuDefaultImg: string;
}
//获取SKU数据接口
export interface SkuInfoData extends ResponseData{
    data:SkuData[]
}